Kanzi 4.0.0-beta2
BitmapImage Class Reference

BitmapImage is the basic runtime primitive to load, hold, and convert image data in memory. More...

Inheritance diagram for BitmapImage:
[legend]

Public Member Functions

 BitmapImage (int width, int height, GraphicsFormat format, byte[] data, String name)
 Creates a BitmapImage.
 
 BitmapImage (int width, int height, GraphicsFormat format, String name)
 Creates a BitmapImage.
 
GraphicsFormat getDataFormat ()
 Returns the GraphicsFormat of this BitmapImage.
 
int getHeight ()
 Returns the width of this BitmapImage.
 
int getHeight (int mipmapLevel)
 Returns the height of the given mipmaplevel of this BitmapImage.
 
int getMipmapLevelCount ()
 Returns the mipmap level count of this BitmapImage.
 
long getNative ()
 Gets a pointer to the backing C++ instance.
 
int getWidth ()
 Returns the width of this BitmapImage.
 
int getWidth (int mipmapLevel)
 Returns the width of the given mipmaplevel of this BitmapImage.
 
void premultiplyAlpha ()
 Premultiplies the color and luminance channels by the alpha channel.
 

Detailed Description

BitmapImage is the basic runtime primitive to load, hold, and convert image data in memory.

Each image has width, height, pixel format, image data in memory, and can contain mipmap images.

To display an image, you must create a texture instance from that image. When you do so, you must transfer the ownership of the image to the texture instance using com.rightware.kanzi.TextureBuilder.

Constructor & Destructor Documentation

◆ BitmapImage() [1/2]

BitmapImage ( int width,
int height,
GraphicsFormat format,
String name )

Creates a BitmapImage.

Parameters
widthWidth for this BitmapImage.
heightHeight for this BitmapImage.
formatGraphicsFormat for this BitmapImage.
nameName for this BitmapImage.

◆ BitmapImage() [2/2]

BitmapImage ( int width,
int height,
GraphicsFormat format,
byte[] data,
String name )

Creates a BitmapImage.

Parameters
widthWidth for this BitmapImage.
heightHeight for this BitmapImage.
formatGraphicsFormat for this BitmapImage.
dataData for this BitmapImage.
nameName for this BitmapImage.

Member Function Documentation

◆ getDataFormat()

GraphicsFormat getDataFormat ( )

Returns the GraphicsFormat of this BitmapImage.

Returns
The BitmapImage data's GraphicsFormat.

◆ getHeight() [1/2]

int getHeight ( )

Returns the width of this BitmapImage.

Returns
The BitmapImage's width.
Since
Kanzi 4.0.0 changed return type to int from long.

◆ getHeight() [2/2]

int getHeight ( int mipmapLevel)

Returns the height of the given mipmaplevel of this BitmapImage.

Parameters
mipmapLevelThe mipmap level of the BitmapImage to get the height of.
Returns
The BitmapImage's height of the given mipmaplevel.
Since
Kanzi 4.0.0 changed return type to int from long.

◆ getMipmapLevelCount()

int getMipmapLevelCount ( )

Returns the mipmap level count of this BitmapImage.

Returns
The BitmapImage's mipmap level count.
Since
Kanzi 4.0.0 changed return type to int from long.

◆ getNative()

long getNative ( )

Gets a pointer to the backing C++ instance.

Returns
A pointer to the backing C++ instance. Type: kanzi::BitmapImage*.

◆ getWidth() [1/2]

int getWidth ( )

Returns the width of this BitmapImage.

Returns
The BitmapImage's width.
Since
Kanzi 4.0.0 changed return type to int from long.

◆ getWidth() [2/2]

int getWidth ( int mipmapLevel)

Returns the width of the given mipmaplevel of this BitmapImage.

Parameters
mipmapLevelThe mipmap level of the BitmapImage to get the width of.
Returns
The BitmapImage's width of the given mipmaplevel.
Since
Kanzi 4.0.0 changed return type to int from long.